package com.admin.interfaces.web;

import com.admin.application.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * @author LeeJun
 */
@Controller
@RequestMapping("/member")
public class MemberController {

    @Autowired
    protected MemberService memberService;

    @RequestMapping(method = RequestMethod.GET)
    public String list(Model model, @RequestParam(value = "key", required = false) String key) {
        model.addAttribute("key", key);
        model.addAttribute("list", memberService.list(key));
        return "member/list";
    }


}
